package ca.cbc.panacea.elixir.service;

import javax.faces.application.FacesMessage;
import javax.faces.context.FacesContext;
import javax.inject.Named;

import org.primefaces.event.FileUploadEvent;
import org.primefaces.model.UploadedFile;

@Named("fileUploadController")
public class FileUploadController {

    public void handleFileUpload(FileUploadEvent event) {
        System.out.println("uploading the fileeeeeeeeeeeeeeeeee");
        FacesMessage msg = new FacesMessage("Succesful", event.getFile().getFileName() + " is uploaded.");
        FacesContext.getCurrentInstance().addMessage(null, msg);
    }
}
